[T4Scaffolding.Scaffolder(Description = "Enter a description of HomePage here")][CmdletBinding()]
param(        
    [string]$Project,
	[string]$CodeLanguage,
	[string[]]$TemplateFolders,
	[switch]$Force = $false
)

$outputPath = "Index"  # The filename extension will be added based on the template's <#@ Output Extension="..." #> directive
$namespace = (Get-Project $Project).Properties.Item("DefaultNamespace").Value

$newFile = "Views\Home\Index"

$cnames = Get-ProjectFolder "Controllers" | %{$_} | % {if($_.Name -like "*Controller*"){[System.Text.RegularExpressions.Regex]::Replace($_.Name, "Controller.*$", "", [System.Text.RegularExpressions.RegexOptions]::IgnoreCase)}}

Add-ProjectItemViaTemplate $newFile -Template HomePageTemplate `
	-Model @{ Namespace = $namespace; ExampleValue = "Hello, world!"; ControllerNames = $cnames } `
	-SuccessMessage "Added UpdateHome output at {0}" `
	-TemplateFolders $TemplateFolders -Project $Project -CodeLanguage $CodeLanguage -Force:$Force